package org.example.springbootrabbitmq.normal;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
public class DeadConsume {

    @RabbitListener(queues = {"QD"})
    public void consume2(Message message, Channel channel) {
        String msg = new String(message.getBody());
        log.info("当前时间:{},消息内容：{}---死信消费者-", new Date(),msg);
    }
}
